import math, time
from pml import Objects
from pml import PML

PI = PML.object.ChangeObject.PMLFloat_FromFloat(math.pi)
E = PML.object.ChangeObject.PMLFloat_FromFloat(math.e)

class Random(Objects.object.typeobject):
    pass
class Time(Objects.object.typeobject):
    def __init__(self):
        super().__init__('Time')

    def getObject(self):
        self.staticMethods['time'] = self.time

        return self

    @staticmethod
    def time(frame, this, position):
        return PML.object.ChangeObject.PMLFloat_FromFloat(time.time())

PML_MODULE = PML.module.ModuleSetup(variablesOrFunctions={
    'Random': Random().getObject(),
    'Time': Time().getObject()
}, constants={
    'PI': PI,
    'E': E
})
